
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

void reverse(char *s, int left, int right) {
	

	while (left < right) {

		char tmp = s[left];
		s[left] = s[right];
		s[right] = tmp;
		left++;
		right--;

	}

}

int main() {
	char s[101] = { 0 };
	gets(s);
	//printf("%s\n", s);

	int len = strlen(s);
	reverse(s, 0, len-1);

	//printf("%s\n", s);


	int end = 0;
	int start = 0;
	while (s[start] != '\0') {

		while (s[end] != ' ' && s[end] != '\0') {
			end++;
		}
		reverse(s, start, end - 1);
		//printf("%s\n", s);


		if (s[end] != '\0') {
			end++;
		}
		
		start = end;

	}

	printf("%s\n", s);

	return 0;
}